import request from '@/plugin/axios'
// import querystring from 'querystring' //序列化请求参数

export default {
    saveBlog(data) {
        return request({
            url: '/blog/addBlog',
            method: 'post',
            data
        })
    },

    updateBlog(data) {
        return request({
            url: '/blog/updateBlog',
            method: 'post',
            data
        })
    },

    findBlogClass() {
        return request({
            url: '/blog/findBlogClass',
            method: 'get'
        })
    },

    upImg(data) {
        return request({
            url: '/file/upImg',
            method: 'post',
            data
        })
    },

    addBlogClass(data) {
        return request({
            url: '/blog/addBlogClass',
            method: 'post',
            data
        })
    },

    deleteBlogClass(data) {
        return request({
            url: '/blog/deleteBlogClass',
            method: 'delete',
            data
        })
    },
    deleteBlog(data) {
        return request({
            url: '/blog/deleteBlog',
            method: 'delete',
            data
        })
    },

    findBlogByUsernameHasPage(data) {
        return request({
            url: `/blog/findBlogByUsernameHasPage?className=${data.className}&page=${data.page}&row=${data.row}&userName=${data.userName}&title=${data.title}`,
            method: 'get',
            data
        })
    },

    findBlogByBlogId(blogId) {
        return request({
            url: `/blog/findBlogByBlogId?blogId=${blogId}`,
            method: 'get'
        })
    }
}

